package com.spreedairy.util;

import com.liferay.portal.kernel.util.Validator;
import com.liferay.portlet.shopping.model.ShoppingItem;

public class CommonUtil {
	public static long getImageId(ShoppingItem item){
		long imageId = 0l;
		if(Validator.isNotNull(item)){
			if(item.getSmallImageId() > 0l){
				imageId = item.getSmallImageId();
			} else if(item.getMediumImageId() > 0l){
				imageId = item.getMediumImageId();
			}  else if(item.getLargeImageId() > 0l){
				imageId = item.getLargeImageId();
			}
		}
		return imageId;
	}
}
